<template>
	<view class="container">
		<!-- 浮现栏 -->
		<view v-if="showFloatBar" class="float-bar">
			<view class="float-bar-logo">
				<image src="/static/logo-h.png" class="float-logo"></image>
			</view>
			<button class="float-join-btn" @click="goNotice">加盟我们</button>
		</view>
		<view class="custom-navbar">
			<image src="/static/logo-h.png" class="nav-logo"></image>
		</view>
		<view class="container1">
			<view class="container2">
				<swiper class="home-swiper" :indicator-dots="true" :autoplay="true" :interval="5000" :duration="800" circular @change="onSwiperChange">
					<swiper-item v-for="(item, idx) in swiperList" :key="idx">
						<view class="logo-title-wrap">
							<view :class="['first-letter', item.line1 === 'New' ? 'first-letter-large' : '', currentSwiper === idx ? 'fade-in' : 'fade-out']">
								{{ item.line1 }}
							</view>
							<view :class="['second-letter', currentSwiper === idx ? 'fade-in' : 'fade-out']">{{ item.line2 }}</view>
						</view>
						<image :src="item.img" class="swiper-img" mode="center" />
					</swiper-item>
				</swiper>
			</view>
			<view class="slogan">一起开启奶茶新事业</view>
			<button class="join-btn" @click="goNotice">加盟我们</button>
			<view class="bg-1"></view>
			<view class="bg-2">
				<view class="section">
					<view class="section-title">品牌介绍</view>
					<view class="section-content">《狐灵仙草》旨在以各类精美的新中式鲜奶茶饮品、果味饮品及熟食茶佐，为消费者提供“一杯开运生息的茶”的品牌目标！</view>
				</view>
				<view class="section">
					<view class="section-title">狐灵宣言</view>
					<view class="declaration">
						<view class="declaration-text">
							<view class="declaration-title-image-overlay">
								<image src="/static/img/cup.png" class="declaration-title-cup-large" mode="widthFix" />
								<view class="declaration-title-text-overlay">
									<text>好奶好茶</text>
									<text>自然健康</text>
								</view>
							</view>
							<view class="declaration-paragraph">
								我们严选优质奶源、茶叶原产地，保证每一滴牛奶品质、每一口茶汤口感，将我们的新中式鲜奶茶饮，毫无保留地呈递给您。
							</view>
							<view class="declaration-paragraph">
								我们优选上乘茶叶，采用传统制茶工艺匠心窨制，以确保茶汤呈现给您的清醇香气和口感品质。无论您喜欢绿茶的清新，红茶的浓郁，白茶的柔和，还是乌龙茶的香醇，我们都能满足您的口味偏好。
							</view>
							<view class="declaration-paragraph">每一杯狐灵家的鲜奶茶，都承载了我们对品质的承诺和对传统茶文化的尊重。</view>
							<view class="declaration-sign">—— 宣言 · 狐灵品质</view>
						</view>
					</view>
				</view>
				<view class="section"></view>
				<view class="section-title">加盟流程</view>
				<view class="flow-list-bg-wrap">
					<view class="franchise-bg-text">FOX</view>
					<view class="flow-list">
						<view class="flow-item">
							<view class="flow-serial">01</view>
							<view class="flow-text">联系我们</view>
						</view>
						<view class="flow-item">
							<view class="flow-serial">02</view>
							<view class="flow-text">核实资料</view>
						</view>
						<view class="flow-item">
							<view class="flow-serial">03</view>
							<view class="flow-text">政策宣讲</view>
						</view>
						<view class="flow-item">
							<view class="flow-serial">04</view>
							<view class="flow-text">双向考察</view>
						</view>
						<view class="flow-item">
							<view class="flow-serial">05</view>
							<view class="flow-text">合同签订</view>
						</view>
						<view class="flow-item">
							<view class="flow-serial">06</view>
							<view class="flow-text">选址装修</view>
						</view>
						<view class="flow-item">
							<view class="flow-serial">07</view>
							<view class="flow-text">培训开业</view>
						</view>
					</view>
				</view>
				<view class="join-box">
					<view class="join-title">
						加盟我们
						<br />
						<span>Join us</span>
					</view>
					<view class="join-btn-wrap">
						<button class="pink-btn" @click="goNotice">立即加盟</button>
					</view>
				</view>
			</view>
		</view>
		<!-- 右下角悬浮按钮组 -->
		<view class="fab-rect-group">
			<view class="fab-rect-btn fab-rect-hotline" @click="callHotline">
				<image class="fab-rect-icon" src="/static/img/rect/热线.png" mode="aspectFit" />
				<text>热线</text>
			</view>
			<view class="fab-rect-btn fab-rect-join" @click="goJoin">
				<image class="fab-rect-icon" src="@/static/img/rect/加盟.png" mode="aspectFit" />
				<text>加盟</text>
			</view>
		</view>
	</view>
</template>
<script>
export default {
	data() {
		return {
			swiperList: [
				{
					img: '/static/img/slider/banner1.png',
					line1: 'Lucky Fox',
					line2: 'Tea shop'
				},
				{
					img: '/static/img/slider/banner2.png',
					line1: 'New',
					line2: 'Life Style'
				},
				{
					img: '/static/img/slider/banner3.png',
					line1: 'Fresh Milk',
					line2: 'Great Tea'
				}
			],
			currentSwiper: 0,
			showFloatBar: false // 控制浮现栏显示
		};
	},
	methods: {
		onSwiperChange(e) {
			this.currentSwiper = e.detail.current;
		},
		goJoin() {
			uni.navigateTo({ url: '/pages/join/join' });
		},
		goNotice() {
			uni.navigateTo({ url: '/pages/notice/notice' });
		},
		callHotline() {
			uni.makePhoneCall({ phoneNumber: '4008888888' });
		}
	},
	// 监听页面滚动
	onPageScroll(e) {
		// 88rpx 是 custom-navbar 的高度，logo 完全消失后浮现栏出现
		this.showFloatBar = e.scrollTop > 80;
	}
};
</script>
<style>
@font-face {
	font-family: 'LillyBelle';
	src: url('~@/static/fonts/LillyBelle.woff2') format('woff2');
	font-style: normal;
}
</style>
<style scoped>
.logo-title-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 0;
}
.first-letter {
	font-family: 'LillyBelle';
	font-size: 130rpx;
	font-weight: 400;
	color: #ffffff;
	margin-right: 2rpx;
	line-height: 1.1;
}
.second-letter {
	font-family: 'LillyBelle';
	font-size: 130rpx;
	font-weight: 400;
	color: #ffffff;
	margin-right: 2rpx;
	margin-top: 0;
	line-height: 1.1;
}
.custom-navbar {
	margin-bottom: 60rpx;
	display: flex;
	align-items: center;
	height: 88rpx;
	padding: 0 32rpx;
	background: #beb996;
}
.nav-logo {
	width: 200rpx;
	height: 60rpx;
	margin-top: 64rpx;
	margin-right: 16rpx;
}
.nav-title {
	font-size: 36rpx;
	font-weight: bold;
	color: #333;
}

.container {
	background-color: #beb996;
}
.container1 {
	margin: 32rpx;
	background-color: #beb996;
}
.bg-1 {
	height: 110rpx;
	background-image: url('@/static/img/background/pattern-2.png');
	margin-left: -32rpx;
	margin-right: -32rpx;
}
.bg-2 {
	background-color: #ffffff;
	margin-left: -32rpx;
	margin-right: -32rpx;
	padding: 32rpx;
}
.primary-bg {
	height: 110rpx;
	background-image: url('@/static/img/background/pattern-2.png');
	transform: translateY(0%) translateX(0%) rotate(180deg);
	margin-left: -32rpx;
	margin-right: -32rpx;
}
.slogan {
	text-align: center;
	color: #ffffff;
	margin-bottom: 32rpx;
	margin-top: 32rpx;
}
.section {
	margin-bottom: 32rpx;
	background-color: #ffffff;
}
.section-title {
	font-weight: bold;
	margin-bottom: 8rpx;
	text-align: center;
}
.section-content {
	margin-top: 20rpx;
	font-size: 26rpx;
	text-align: left;
	text-indent: 2em;
}
.adv-list,
.flow-list {
	display: flex;
	flex-wrap: wrap;
	gap: 16rpx;
}
.adv-item,
.flow-item {
	background: #f0f9eb;
	padding: 16rpx 32rpx;
	border-radius: 32rpx;
}
button {
	width: 100%;
	margin-top: 32rpx;
}
.home-swiper {
	width: 100%;
	height: 400rpx;
	margin: 32rpx 0;
	border-radius: 24rpx;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.swiper-img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	position: absolute;
	left: 0;
	top: 0;
	z-index: 0;
}
.logo-title-wrap {
	position: relative;
	z-index: 1;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}
.first-letter-large {
	font-size: 160rpx !important;
}
.fade-in {
	opacity: 1;
	transition: opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.fade-out {
	opacity: 0;
	transition: opacity 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.first-letter,
.second-letter {
	text-shadow: 4rpx 8rpx 16rpx rgba(0, 0, 0, 0.4);
}
.join-btn {
	width: 40%;
	margin: 24rpx auto 0 auto;
	display: block;
	background: #de9190;
	color: #fff;
	font-size: 32rpx;
	border-radius: 40rpx;
	height: 80rpx;
	line-height: 80rpx;
	font-weight: bold;
	box-shadow: 0 4rpx 16rpx rgba(255, 127, 80, 0.15);
}
.declaration {
	display: flex;
	margin-top: 20rpx;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	padding: 24rpx 0;
	background-size: cover;
	border-radius: 24rpx;
	border: 4rpx solid #ffb6c1;
	box-sizing: border-box;
	background-color: #fff0f6;
}
.declaration-text {
	font-size: 24rpx;
	color: #333;
	text-align: left;
	line-height: 1.8;
	display: flex;
	flex-direction: column;
	gap: 12rpx;
	margin-left: 24rpx;
}
.declaration-title {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	font-size: 28rpx;
	font-weight: bold;
	color: #de9190;
	margin-bottom: 8rpx;
	gap: 12rpx;
}
.declaration-title-cup {
	width: 38rpx;
	height: 38rpx;
	margin-right: 8rpx;
	vertical-align: middle;
}
.declaration-sign {
	margin-top: 16rpx;
	color: #de9190;
	font-weight: bold;
	font-size: 22rpx;
	text-align: end;
	margin-right: 10rpx;
}
.declaration-title-image {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-bottom: 16rpx;
}
.declaration-title-image-overlay {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 600rpx;
	height: 400rpx;
	margin: 0 auto 16rpx auto;
}
.declaration-title-cup-large {
	width: 400rpx;
	height: 400rpx;
	display: block;
}
.declaration-title-text-overlay {
	position: absolute;
	left: 60rpx;
	top: 50%;
	width: 100%;
	transform: translateY(-50%);
	transform: translateX(-5%);
	font-size: 40rpx;
	font-weight: bold;
	color: #de9190;
	text-align: justify;
	text-shadow: 2rpx 4rpx 8rpx rgba(255, 255, 255, 0.8), 0 2rpx 8rpx rgba(0, 0, 0, 0.08);
	pointer-events: none;
	display: flex;
	flex-direction: row;
	align-items: center;
	white-space: nowrap;
	word-break: keep-all;
	gap: 20%;
}
.declaration-title-text-overlay text {
	white-space: nowrap;
	justify-content: space-between;
	width: 375rpx;
}
.declaration-paragraph {
	text-indent: 2em;
	text-align: left;
	font-size: 24rpx;
	margin-bottom: 8rpx;
}
.flow-list {
	display: flex;
	margin-top: 40rpx;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16rpx;
}
.flow-item {
	position: relative;
	background: rgba(190, 185, 150, 0.95);
	padding: 24rpx 48rpx 24rpx 48rpx;
	border-radius: 20rpx;
	min-width: 260rpx;
	min-height: 40rpx;
	margin-bottom: 30rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6rpx 24rpx rgba(0, 0, 0, 0.12), 0 1.5rpx 4rpx rgba(0, 0, 0, 0.08);
}
.flow-serial {
	position: absolute;
	left: -30rpx;
	top: -30rpx;
	font-size: 50rpx;
	color: #f67900;
	font-weight: bold;
	background: transparent;
	z-index: 2;
	text-transform: capitalize;
}
.flow-text {
	font-size: 30rpx;
	font-weight: 600;
	color: #ffffff;
	font-weight: 500;
	z-index: 1;
	text-align: center;
	width: 100%;
}
.flow-list-bg-wrap {
	position: relative;
	width: 100%;
	display: flex;
	justify-content: center;
}
.franchise-bg-text {
	position: absolute;
	right: 0;
	transform: translateY(10%) translateX(25%) rotate(90deg);
	font-size: 320rpx;
	font-weight: bold;
	color: rgba(120, 120, 120, 0.08);
	letter-spacing: 10rpx;
	z-index: 0;
	width: 100vw;
	max-width: 100vw;
	overflow-x: hidden;
	text-align: right;
	pointer-events: none;
	user-select: none;
	white-space: nowrap;
}
.flow-list {
	position: relative;
	z-index: 1;
}
.join-title {
	text-align: center;
	color: #de9190;
	font-size: 36rpx;
	font-weight: bold;
	margin-bottom: 24rpx;
	line-height: 1.2;
}
.join-title span {
	font-size: 24rpx;
	color: #f67900;
	font-weight: normal;
}
.join-btn-wrap {
	position: relative;
	width: 80%;
	margin: 0 auto;
	display: flex;
	justify-content: center;
	align-items: flex-start;
}
.pink-btn {
	width: 100%;
	background: #ffb6c1;
	color: #fff;
	font-size: 32rpx;
	border-radius: 40rpx;
	height: 80rpx;
	line-height: 80rpx;
	font-weight: bold;
	box-shadow: 0 4rpx 16rpx rgba(255, 127, 80, 0.15);
	border: none;
	position: relative;
	margin: 0 auto;
	display: block;
}
.pattern-divider {
	width: 100%;
	height: 80rpx;
	background: url('/static/img/background/pattern-2.png') center center repeat-x;
	background-size: auto 100%;
	margin: 0;
	padding: 0;
}
.join-box {
	width: 100%;
	min-height: 340rpx;
	background-size: cover;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 48rpx 0 64rpx 0;
	box-sizing: border-box;
}
.float-bar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 128rpx;
	background: #fff;
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	z-index: 999;
	box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
	padding: 0 32rpx;
	transition: all 0.3s;
}
.float-bar-logo {
	padding-top: 30rpx;
}
.float-logo {
	height: 60rpx;
	width: 200rpx;
	margin-top: 0;
}
.float-join-btn {
	background: #de9190;
	color: #fff;
	font-size: 28rpx;
	border-radius: 40rpx;
	height: 60rpx;
	line-height: 60rpx;
	font-weight: bold;
	box-shadow: 0 2rpx 8rpx rgba(255, 127, 80, 0.08);
	border: none;
	width: auto;
	min-width: 120rpx;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: 32rpx;
}
.fab-group {
	position: fixed;
	right: 40rpx;
	bottom: 80rpx;
	display: flex;
	flex-direction: column;
	gap: 24rpx;
	z-index: 1000;
}
.fab-btn {
	width: 100rpx;
	height: 100rpx;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.12);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 32rpx;
	font-weight: bold;
	color: #de9190;
	border: none;
	outline: none;
	transition: box-shadow 0.2s;
}
.fab-btn:active {
	box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.18);
}
.fab-hotline {
	background: linear-gradient(135deg, #ffb6c1 60%, #de9190 100%);
	color: #fff;
}
.fab-join {
	background: linear-gradient(135deg, #fff0f6 60%, #de9190 100%);
	color: #de9190;
}
.fab-rect-group {
	position: fixed;
	right: 20rpx;
	bottom: 80rpx;
	width: 80rpx;
	height: 220rpx;
	display: flex;
	flex-direction: column;
	border-radius: 48rpx;
	overflow: hidden;
	box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.12);
	background: #fff;
	z-index: 1000;
}
.fab-rect-btn {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	font-size: 22rpx;
	font-weight: bold;
	border: none;
	outline: none;
	transition: background 0.2s;
	user-select: none;
}
.fab-rect-icon {
	width: 36rpx;
	height: 36rpx;
	margin-bottom: 6rpx;
	display: block;
}
.fab-rect-hotline {
	background: linear-gradient(135deg, #ffb6c1 60%, #de9190 100%);
	color: #fff;
	border-bottom: 1rpx solid #fff0f6;
}
.fab-rect-join {
	background: linear-gradient(135deg, #fff0f6 60%, #de9190 100%);
	color: #de9190;
}
.fab-rect-btn:active {
	filter: brightness(0.95);
}
</style>
<style>
page {
	overflow-x: hidden;
}
</style>
